package com.travel.photos.ui.otheruser;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.travel.R;
import com.travel.photos.bean.FindDataListBean;
import com.travel.photos.bean.OtherUserBean;
import com.travel.photos.bean.PhotoRecommentBean;
import com.travel.photos.image.ImageHepler;

import java.util.List;

import butterknife.Bind;
import butterknife.ButterKnife;
import tools.AdapterUtils;

/**
 * Created by meidou on 2016/10/18.
 * find中点赞
 */
public class OtherUserAdapter extends AdapterUtils<OtherUserBean.DataBean.ListBean> {
    public OtherUserAdapter(Context mcontext, List<OtherUserBean.DataBean.ListBean> totalList) {
        super(mcontext, totalList);
    }

    @Override
    public View getMyView(int position, View convertView, ViewGroup parent) {
        ViewHolder viewHolder;
        if(convertView==null){
            convertView = mInflater.inflate(R.layout.image_text, parent, false);
            viewHolder = new ViewHolder(convertView);
            convertView.setTag(viewHolder);
        }else {
            viewHolder= (ViewHolder) convertView.getTag();
        }
        ImageHepler.showImage(mcontext,totalList.get(position).getPath().get(0),viewHolder.mPhotoFindItemGridImage,false);
        viewHolder.mTextView.setText(totalList.get(position).getLocation());
        return convertView;
    }

    static class ViewHolder {
        @Bind(R.id.image_text_image)
        ImageView mPhotoFindItemGridImage;
        @Bind(R.id.image_text_text)
        TextView  mTextView;

        ViewHolder(View view) {
            ButterKnife.bind(this, view);
        }
    }
}
